<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增【请填写功能名称】')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-vehiclestationinfo-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">车辆名：</label>
            <div class="col-sm-8">
                <select name="VehicleID" th:with="type=${@veVehiclesServiceImpl.getVeVehiclesList()}">
                    <option th:each="dict : ${type}" th:text="${dict.vehicleName}"
                            th:value="${dict.vehicleID}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">驻地名：</label>
            <div class="col-sm-8">
                <select name="StationID" th:with="type=${@veStationinfoServiceImpl.getVeStationinfoList()}">
                    <option th:each="dict : ${type}" th:text="${dict.name}" th:value="${dict.stationID}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">驻地日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="StationDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">驻地时长：</label>
            <div class="col-sm-8">
                <input name="StationDuration" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">车辆状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_vehicle_status')}">
                    <input type="radio" th:id="${dict.dictCode}" name="vehicleStatus" th:value="${dict.dictValue}"
                           th:checked="${dict.default}">
                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
    var prefix = ctx + "system/vehiclestationinfo"
    $("#form-vehiclestationinfo-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-vehiclestationinfo-add').serialize());
        }
    }

    $("input[name='StationDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>